package com.fuful.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class OrderTools {
    private static String getNowDate(){
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
        return simpleDateFormat.format(date);
    }
    private static String getRandom(){
        String rand = "";
        for (int i = 0;i < 8;i++){
            rand = rand + (int)(Math.random()*10);
        }
        return rand;
    }

    public static String createOrderCode(){
        return getNowDate()+getRandom();
    }
}
